@import "variables";
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

// Base styles
html {
  box-sizing: border-box;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background-color: $background;
  color: $text;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: $leading-normal;
  overflow-x: hidden;
}

// Typography
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: $spacing-4;
  font-weight: $font-semibold;
  line-height: $leading-tight;
  color: $gray-900;
}

p {
  margin-top: 0;
  margin-bottom: $spacing-4;
}

a {
  color: $primary;
  text-decoration: none;
  transition: $transition-base;
  
  &:hover {
    color: $primary-dark;
  }
}

// Container
.container {
  width: 100%;
  padding-right: $spacing-4;
  padding-left: $spacing-4;
  margin-right: auto;
  margin-left: auto;
  
  @media (min-width: $breakpoint-sm) {
    max-width: 540px;
    padding-right: $spacing-5;
    padding-left: $spacing-5;
  }
  
  @media (min-width: $breakpoint-md) {
    max-width: 720px;
    padding-right: $spacing-6;
    padding-left: $spacing-6;
  }
  
  @media (min-width: $breakpoint-lg) {
    max-width: 960px;
  }
  
  @media (min-width: $breakpoint-xl) {
    max-width: 1140px;
  }
  
  @media (min-width: $breakpoint-2xl) {
    max-width: 1320px;
  }
}

.container-fluid {
  width: 100%;
  padding-right: $spacing-4;
  padding-left: $spacing-4;
  margin-right: auto;
  margin-left: auto;
}

// Card styles
.card {
  background-color: $card-bg;
  border-radius: $radius-lg;
  box-shadow: $shadow-sm;
  border: 1px solid $border;
  overflow: hidden;
  transition: $transition-base;

  &:hover {
    box-shadow: $shadow-md;
  }
}

// Enhanced card styles
.enhanced-card {
  border-radius: $radius-lg;
  overflow: hidden;
  box-shadow: $shadow-sm;
  border: 1px solid $gray-100;
  transition: all 0.3s ease;
  background-color: white;

  &:hover {
    box-shadow: $shadow-md;
    transform: translateY(-2px);
  }

  .ant-card-head {
    border-bottom: 1px solid $gray-100;
    padding: $spacing-4 $spacing-6;
    min-height: 56px;
  }

  .ant-card-head-title {
    padding: 0;
    font-weight: $font-medium;
  }

  .ant-card-body {
    padding: $spacing-5 $spacing-6;
  }
  
  @media (max-width: $breakpoint-md) {
    .ant-card-head {
      padding: $spacing-4;
    }
    
    .ant-card-body {
      padding: $spacing-4;
    }
  }
}

// Project card specific styles
.project-card-enhanced {
  &:hover {
    transform: translateY(-2px);
    box-shadow: $shadow-md;
  }
}

// Fixed height project cards
.fixed-height-card {
  height: 220px;
  display: flex;
  flex-direction: column;
  
  @media (max-width: $breakpoint-md) {
    height: auto;
  }
}

// Improved card content layout
.card-content-layout {
  display: flex;
  flex-direction: column;
  height: 100%;

  .card-header {
    margin-bottom: $spacing-3;
  }

  .card-body {
    flex: 1;
  }

  .card-footer {
    margin-top: auto;
    padding-top: $spacing-3;
    border-top: 1px solid $gray-100;
  }
}

// Tag styles
.tag {
  display: inline-flex;
  align-items: center;
  padding: $spacing-1 $spacing-2;
  border-radius: $radius-md;
  font-size: $text-xs;
  font-weight: $font-medium;
  line-height: 1.5;

  &.tag-blue {
    background-color: $primary-50;
    color: $primary-600;
  }

  &.tag-green {
    background-color: $success-50;
    color: $success-600;
  }

  &.tag-amber {
    background-color: $warning-50;
    color: $warning-600;
  }

  &.tag-purple {
    background-color: #f5f3ff;
    color: #7c3aed;
  }

  &.tag-red {
    background-color: $danger-50;
    color: $danger-600;
  }

  &.tag-cyan {
    background-color: $info-50;
    color: $info-600;
  }

  &.tag-gray {
    background-color: $gray-100;
    color: $gray-600;
  }
}

// Tag container to prevent wrapping
.tag-container {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: $spacing-2;
  padding-bottom: $spacing-2;

  &::-webkit-scrollbar {
    height: 4px;
  }

  &::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
  }
}

// Button styles
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: $radius-md;
  padding: $spacing-2 $spacing-4;
  font-weight: $font-medium;
  transition: $transition-base;
  cursor: pointer;
  border: none;
  font-size: $text-sm;

  &.btn-primary {
    background-color: $primary;
    color: white;

    &:hover {
      background-color: $primary-dark;
    }
  }

  &.btn-secondary {
    background-color: white;
    color: $text;
    border: 1px solid $border;

    &:hover {
      background-color: $gray-50;
    }
  }

  &.btn-ghost {
    background-color: transparent;
    color: $text;

    &:hover {
      background-color: rgba(0, 0, 0, 0.05);
    }
  }
  
  &.btn-sm {
    padding: $spacing-1 $spacing-3;
    font-size: $text-xs;
  }
  
  &.btn-lg {
    padding: $spacing-3 $spacing-6;
    font-size: $text-base;
  }
}

// Input styles
.input {
  border-radius: $radius-md;
  border: 1px solid $border;
  padding: $spacing-2 $spacing-3;
  transition: $transition-base;
  width: 100%;
  font-size: $text-sm;

  &:focus {
    border-color: $primary;
    box-shadow: 0 0 0 2px rgba($primary, 0.2);
    outline: none;
  }
  
  &.input-sm {
    padding: $spacing-1 $spacing-2;
    font-size: $text-xs;
  }
  
  &.input-lg {
    padding: $spacing-3 $spacing-4;
    font-size: $text-base;
  }
}

// Heading styles
.heading {
  color: $text;
  margin: 0;

  &.heading-1 {
    font-size: $text-3xl;
    font-weight: $font-bold;
    
    @media (min-width: $breakpoint-md) {
      font-size: $text-4xl;
    }
  }

  &.heading-2 {
    font-size: $text-2xl;
    font-weight: $font-semibold;
    
    @media (min-width: $breakpoint-md) {
      font-size: $text-3xl;
    }
  }

  &.heading-3 {
    font-size: $text-xl;
    font-weight: $font-semibold;
    
    @media (min-width: $breakpoint-md) {
      font-size: $text-2xl;
    }
  }

  &.heading-4 {
    font-size: $text-lg;
    font-weight: $font-medium;
    
    @media (min-width: $breakpoint-md) {
      font-size: $text-xl;
    }
  }
}

// Text styles
.text {
  color: $text;

  &.text-secondary {
    color: $text-secondary;
  }

  &.text-tertiary {
    color: $text-tertiary;
  }

  &.text-xs {
    font-size: $text-xs;
  }

  &.text-sm {
    font-size: $text-sm;
  }

  &.text-base {
    font-size: $text-base;
  }

  &.text-lg {
    font-size: $text-lg;
  }
}

// Layout helpers
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-nowrap {
  flex-wrap: nowrap;
}

.items-start {
  align-items: flex-start;
}

.items-center {
  align-items: center;
}

.items-end {
  align-items: flex-end;
}

.justify-start {
  justify-content: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

.justify-evenly {
  justify-content: space-evenly;
}

// Gap utilities
.gap-0 {
  gap: $spacing-0;
}

.gap-1 {
  gap: $spacing-1;
}

.gap-2 {
  gap: $spacing-2;
}

.gap-3 {
  gap: $spacing-3;
}

.gap-4 {
  gap: $spacing-4;
}

.gap-5 {
  gap: $spacing-5;
}

.gap-6 {
  gap: $spacing-6;
}

.gap-8 {
  gap: $spacing-8;
}

.gap-10 {
  gap: $spacing-10;
}

.gap-12 {
  gap: $spacing-12;
}

// Margin utilities
.m-0 {
  margin: $spacing-0;
}

.m-1 {
  margin: $spacing-1;
}

.m-2 {
  margin: $spacing-2;
}

.m-3 {
  margin: $spacing-3;
}

.m-4 {
  margin: $spacing-4;
}

.m-5 {
  margin: $spacing-5;
}

.m-6 {
  margin: $spacing-6;
}

.m-8 {
  margin: $spacing-8;
}

.m-auto {
  margin: auto;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.my-auto {
  margin-top: auto;
  margin-bottom: auto;
}

.mt-0 {
  margin-top: $spacing-0;
}

.mt-1 {
  margin-top: $spacing-1;
}

.mt-2 {
  margin-top: $spacing-2;
}

.mt-3 {
  margin-top: $spacing-3;
}

.mt-4 {
  margin-top: $spacing-4;
}

.mt-5 {
  margin-top: $spacing-5;
}

.mt-6 {
  margin-top: $spacing-6;
}

.mt-8 {
  margin-top: $spacing-8;
}

.mt-10 {
  margin-top: $spacing-10;
}

.mt-12 {
  margin-top: $spacing-12;
}

.mb-0 {
  margin-bottom: $spacing-0;
}

.mb-1 {
  margin-bottom: $spacing-1;
}

.mb-2 {
  margin-bottom: $spacing-2;
}

.mb-3 {
  margin-bottom: $spacing-3;
}

.mb-4 {
  margin-bottom: $spacing-4;
}

.mb-5 {
  margin-bottom: $spacing-5;
}

.mb-6 {
  margin-bottom: $spacing-6;
}

.mb-8 {
  margin-bottom: $spacing-8;
}

.mb-10 {
  margin-bottom: $spacing-10;
}

.mb-12 {
  margin-bottom: $spacing-12;
}

// Padding utilities
.p-0 {
  padding: $spacing-0;
}

.p-1 {
  padding: $spacing-1;
}

.p-2 {
  padding: $spacing-2;
}

.p-3 {
  padding: $spacing-3;
}

.p-4 {
  padding: $spacing-4;
}

.p-5 {
  padding: $spacing-5;
}

.p-6 {
  padding: $spacing-6;
}

.p-8 {
  padding: $spacing-8;
}

.px-0 {
  padding-left: $spacing-0;
  padding-right: $spacing-0;
}

.px-1 {
  padding-left: $spacing-1;
  padding-right: $spacing-1;
}

.px-2 {
  padding-left: $spacing-2;
  padding-right: $spacing-2;
}

.px-3 {
  padding-left: $spacing-3;
  padding-right: $spacing-3;
}

.px-4 {
  padding-left: $spacing-4;
  padding-right: $spacing-4;
}

.px-5 {
  padding-left: $spacing-5;
  padding-right: $spacing-5;
}

.px-6 {
  padding-left: $spacing-6;
  padding-right: $spacing-6;
}

.py-0 {
  padding-top: $spacing-0;
  padding-bottom: $spacing-0;
}

.py-1 {
  padding-top: $spacing-1;
  padding-bottom: $spacing-1;
}

.py-2 {
  padding-top: $spacing-2;
  padding-bottom: $spacing-2;
}

.py-3 {
  padding-top: $spacing-3;
  padding-bottom: $spacing-3;
}

.py-4 {
  padding-top: $spacing-4;
  padding-bottom: $spacing-4;
}

.py-5 {
  padding-top: $spacing-5;
  padding-bottom: $spacing-5;
}

.py-6 {
  padding-top: $spacing-6;
  padding-bottom: $spacing-6;
}

// Circle icon styles
.circle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: $font-semibold;

  &.circle-blue {
    background-color: $primary-100;
    color: $primary-600;
  }

  &.circle-green {
    background-color: $success-100;
    color: $success-600;
  }

  &.circle-amber {
    background-color: $warning-100;
    color: $warning-600;
  }

  &.circle-purple {
    background-color: #f3e8ff;
    color: #7e22ce;
  }

  &.circle-red {
    background-color: $danger-100;
    color: $danger-600;
  }

  &.circle-cyan {
    background-color: $info-100;
    color: $info-600;
  }
}

// Enhanced circle icons
.circle-icon-enhanced {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  
  // Ensure all icons inside have white color
  .anticon {
    color: white;
  }
  
  @media (max-width: $breakpoint-md) {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  @media (max-width: $breakpoint-sm) {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}

// Grid system
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -$spacing-3;
  margin-left: -$spacing-3;
  
  @media (max-width: $breakpoint-sm) {
    margin-right: -$spacing-2;
    margin-left: -$spacing-2;
  }
}

.col {
  position: relative;
  width: 100%;
  padding-right: $spacing-3;
  padding-left: $spacing-3;
  
  @media (max-width: $breakpoint-sm) {
    padding-right: $spacing-2;
    padding-left: $spacing-2;
  }
}

// Responsive grid columns
@mixin make-col($size, $columns: 12) {
  flex: 0 0 percentage($size / $columns);
  max-width: percentage($size / $columns);
}

@mixin make-grid-columns($breakpoint) {
  @for $i from 1 through 12 {
    .col-#{$breakpoint}-#{$i} {
      @include make-col($i);
    }
  }
}

// XS Grid (default)
@for $i from 1 through 12 {
  .col-#{$i} {
    @include make-col($i);
  }
}

// SM Grid
@media (min-width: $breakpoint-sm) {
  @include make-grid-columns('sm');
}

// MD Grid
@media (min-width: $breakpoint-md) {
  @include make-grid-columns('md');
}

// LG Grid
@media (min-width: $breakpoint-lg) {
  @include make-grid-columns('lg');
}

// XL Grid
@media (min-width: $breakpoint-xl) {
  @include make-grid-columns('xl');
}

// 2XL Grid
@media (min-width: $breakpoint-2xl) {
  @include make-grid-columns('2xl');
}

// Visibility utilities
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.invisible {
  visibility: hidden !important;
}

@media (max-width: $breakpoint-sm) {
  .hidden-xs {
    display: none !important;
  }
}

@media (min-width: $breakpoint-sm) and (max-width: $breakpoint-md) {
  .hidden-sm {
    display: none !important;
  }
}

@media (min-width: $breakpoint-md) and (max-width: $breakpoint-lg) {
  .hidden-md {
    display: none !important;
  }
}

@media (min-width: $breakpoint-lg) and (max-width: $breakpoint-xl) {
  .hidden-lg {
    display: none !important;
  }
}

@media (min-width: $breakpoint-xl) {
  .hidden-xl {
    display: none !important;
  }
}

// Custom scrollbar
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: $gray-100;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: $gray-300;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: $gray-400;
}

// Gradient backgrounds
.bg-gradient-blue {
  background: linear-gradient(135deg, $primary-500 0%, $primary-400 100%);
}

.bg-gradient-purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
}

.bg-gradient-green {
  background: linear-gradient(135deg, $success-500 0%, #34d399 100%);
}

.bg-gradient-amber {
  background: linear-gradient(135deg, $warning-500 0%, #fbbf24 100%);
}

.bg-gradient-red {
  background: linear-gradient(135deg, $danger-500 0%, #f87171 100%);
}

.bg-gradient-cyan {
  background: linear-gradient(135deg, $info-500 0%, #22d3ee 100%);
}

// Full-width container
.full-width-container {
  width: 100%;
  max-width: 100%;
  padding: $spacing-6;
  
  @media (max-width: $breakpoint-md) {
    padding: $spacing-4;
  }
}

// Status badges
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;

  &.status-dev {
    background-color: $info-50;
    color: $info-600;
  }

  &.status-test {
    background-color: $success-50;
    color: $success-600;
  }

  &.status-staging {
    background-color: $warning-50;
    color: $warning-600;
  }

  &.status-prod {
    background-color: $danger-50;
    color: $danger-600;
  }
}

// Filter card styles
.filter-card {
  background-color: white;
  border-radius: $radius-lg;
  padding: $spacing-4;
  box-shadow: $shadow-sm;
  border: 1px solid $border;
  
  @media (max-width: $breakpoint-md) {
    padding: $spacing-3;
  }
}

.filter-controls {
  display: flex;
  gap: $spacing-4;
  align-items: center;
  flex-wrap: wrap;

  .filter-input {
    flex: 1;
    min-width: 200px;
  }

  .filter-select {
    min-width: 160px;
  }

  @media (max-width: $breakpoint-md) {
    gap: $spacing-3;
    
    .filter-input, .filter-select {
      min-width: 100%;
    }
  }
  
  @media (max-width: $breakpoint-sm) {
    flex-direction: column;
    align-items: stretch;
    
    .filter-input, .filter-select {
      width: 100%;
    }
  }
}

// Pagination container
.pagination-container {
  margin-top: $spacing-6;
  display: flex;
  justify-content: flex-end;
  
  @media (max-width: $breakpoint-md) {
    margin-top: $spacing-4;
    justify-content: center;
  }
}

// Loading container
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 400px;
  
  @media (max-width: $breakpoint-md) {
    height: 300px;
  }
  
  @media (max-width: $breakpoint-sm) {
    height: 200px;
  }
}

// Empty container
.empty-container {
  background-color: white;
  border-radius: $radius-lg;
  padding: $spacing-8;
  box-shadow: $shadow-sm;
  text-align: center;
  
  @media (max-width: $breakpoint-md) {
    padding: $spacing-6;
  }
  
  @media (max-width: $breakpoint-sm) {
    padding: $spacing-4;
  }
}

// Projects header
.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: $spacing-6;
  
  @media (max-width: $breakpoint-md) {
    flex-direction: column;
    align-items: flex-start;
    gap: $spacing-4;
    margin-bottom: $spacing-4;
  }
}

// Projects content
.projects-content {
  margin-bottom: $spacing-6;
  
  @media (max-width: $breakpoint-md) {
    margin-bottom: $spacing-4;
  }
}

// Department view enhancements
.department-header-card {
  border-radius: $radius-xl;
  box-shadow: $shadow-md;
  background: white;
  padding: $spacing-6;
  transition: all 0.3s ease;
  
  &:hover {
    box-shadow: $shadow-lg;
  }
  
  @media (max-width: $breakpoint-md) {
    padding: $spacing-4;
    border-radius: $radius-lg;
  }
}

.department-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  
  @media (max-width: $breakpoint-md) {
    flex-direction: column;
    gap: $spacing-4;
  }
}

.department-info {
  flex: 1;
}

.department-title-container {
  display: flex;
  align-items: center;
  gap: $spacing-4;
  margin-bottom: $spacing-4;
  
  @media (max-width: $breakpoint-md) {
    gap: $spacing-3;
    margin-bottom: $spacing-3;
  }
}

.department-title {
  font-weight: $font-semibold !important;
  font-size: $text-2xl !important;
  line-height: 1.4 !important;
  color: $gray-900;
  margin: 0 !important;
  
  @media (max-width: $breakpoint-md) {
    font-size: $text-xl !important;
  }
}

.department-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: $spacing-3;
  margin-bottom: $spacing-3;
  
  @media (max-width: $breakpoint-sm) {
    gap: $spacing-2;
    margin-bottom: $spacing-2;
  }
}

.department-count {
  font-size: $text-sm;
  color: $gray-600;
}

.department-description {
  font-size: $text-sm;
  color: $gray-600;
  line-height: 1.6;
  margin-top: $spacing-2;
  
  @media (max-width: $breakpoint-md) {
    font-size: $text-xs;
  }
}

// Ant Design overrides
.ant-btn {
  border-radius: 8px;
  font-weight: 500;
  height: 36px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;

  &.ant-btn-primary {
    background: linear-gradient(135deg, $primary-500 0%, $primary-600 100%);
    border: none;
    box-shadow: 0 2px 4px rgba($primary-500, 0.3);

    &:hover {
      background: linear-gradient(135deg, $primary-600 0%, $primary-700 100%);
      transform: translateY(-1px);
      box-shadow: 0 4px 6px rgba($primary-500, 0.4);
    }
  }

  &.ant-btn-default {
    border: 1px solid $gray-200;
    background: white;

    &:hover {
      border-color: $primary-500;
      color: $primary-500;
    }
  }

  .anticon {
    font-size: 16px;
  }
  
  @media (max-width: $breakpoint-md) {
    height: 32px;
    padding: 0 12px;
    font-size: $text-xs;
    
    .anticon {
      font-size: 14px;
    }
  }
}

.ant-input, .ant-input-affix-wrapper {
  border-radius: 8px;
  border: 1px solid $gray-200;
  padding: 8px 12px;
  transition: all 0.2s;

  &:hover {
    border-color: $primary-500;
  }

  &:focus, &-focused {
    border-color: $primary-500;
    box-shadow: 0 0 0 2px rgba($primary-500, 0.2);
  }
  
  @media (max-width: $breakpoint-md) {
    padding: 6px 10px;
    font-size: $text-xs;
  }
}

.ant-select {
  .ant-select-selector {
    border-radius: 8px !important;
    border: 1px solid $gray-200 !important;
    padding: 0 12px !important;
    height: 36px !important;
    transition: all 0.2s !important;

    .ant-select-selection-search-input {
      height: 34px !important;
    }

    .ant-select-selection-item {
      line-height: 34px !important;
    }
  }

  &:hover .ant-select-selector {
    border-color: $primary-500 !important;
  }

  &.ant-select-focused .ant-select-selector {
    border-color: $primary-500 !important;
    box-shadow: 0 0 0 2px rgba($primary-500, 0.2) !important;
  }
  
  @media (max-width: $breakpoint-md) {
    .ant-select-selector {
      height: 32px !important;
      padding: 0 10px !important;
    }
    
    .ant-select-selection-search-input {
      height: 30px !important;
    }
    
    .ant-select-selection-item {
      line-height: 30px !important;
      font-size: $text-xs !important;
    }
  }
}

.ant-card {
  border-radius: $radius-lg;
  overflow: hidden;
  
  @media (max-width: $breakpoint-md) {
    border-radius: $radius-md;
  }
}

.ant-table {
  border-radius: $radius-lg;
  overflow: hidden;
  
  @media (max-width: $breakpoint-md) {
    border-radius: $radius-md;
    
    .ant-table-thead > tr > th,
    .ant-table-tbody > tr > td {
      padding: 10px 8px;
      font-size: $text-xs;
    }
  }
}

// Enhanced table styles
.enhanced-table {
  .ant-table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: $shadow-sm;
  }

  .ant-table-thead > tr > th {
    background-color: $gray-50;
    font-weight: 500;
  }

  .ant-table-tbody > tr:hover > td {
    background-color: $gray-100;
  }
  
  @media (max-width: $breakpoint-lg) {
    .ant-table-thead > tr > th,
    .ant-table-tbody > tr > td {
      padding: 12px 8px;
    }
  }
  
  @media (max-width: $breakpoint-md) {
    .ant-table-thead > tr > th,
    .ant-table-tbody > tr > td {
      padding: 10px 6px;
      font-size: $text-xs;
    }
  }
}

.ant-modal-content {
  border-radius: $radius-lg;
  overflow: hidden;
  
  @media (max-width: $breakpoint-md) {
    border-radius: $radius-md;
  }
}

.ant-tabs-tab {
  padding: $spacing-2 $spacing-4 !important;
  
  @media (max-width: $breakpoint-md) {
    padding: $spacing-1 $spacing-3 !important;
    font-size: $text-xs !important;
  }
}

.ant-tabs-tab + .ant-tabs-tab {
  margin-left: $spacing-2 !important;
}

.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
  font-weight: $font-medium;
}

.ant-breadcrumb {
  font-size: $text-sm;
  
  @media (max-width: $breakpoint-md) {
    font-size: $text-xs;
  }
}

.ant-tag {
  margin-right: 0;
}

// Improved pagination styles
.ant-pagination {
  .ant-pagination-item {
    border-radius: 8px;
    
    &-active {
      border-color: $primary-500;
      
      a {
        color: $primary-500;
      }
    }
  }

  .ant-pagination-prev, .ant-pagination-next {
    .ant-pagination-item-link {
      border-radius: 8px;
    }
  }
  
  @media (max-width: $breakpoint-md) {
    .ant-pagination-item,
    .ant-pagination-prev .ant-pagination-item-link,
    .ant-pagination-next .ant-pagination-item-link {
      min-width: 28px;
      height: 28px;
      line-height: 26px;
    }
    
    .ant-pagination-item a {
      font-size: $text-xs;
    }
  }
}

// Improved modal styles
.ant-modal {
  .ant-modal-content {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: $shadow-xl;
  }

  .ant-modal-header {
    border-bottom: 1px solid $gray-100;
    padding: 16px 24px;
  }

  .ant-modal-body {
    padding: 24px;
  }

  .ant-modal-footer {
    border-top: 1px solid $gray-100;
    padding: 16px 24px;
  }
  
  @media (max-width: $breakpoint-md) {
    .ant-modal-header {
      padding: 12px 16px;
    }
    
    .ant-modal-body {
      padding: 16px;
    }
    
    .ant-modal-footer {
      padding: 12px 16px;
    }
  }
}

// Improved tabs styles
.ant-tabs {
  .ant-tabs-nav {
    margin-bottom: 24px;
    
    @media (max-width: $breakpoint-md) {
      margin-bottom: 16px;
    }
  }

  .ant-tabs-tab {
    padding: 8px 16px !important;
    transition: all 0.2s;
    border-radius: 8px 8px 0 0;

    &:hover {
      color: $primary-500;
    }
    
    @media (max-width: $breakpoint-md) {
      padding: 6px 12px !important;
    }
  }

  .ant-tabs-tab-active {
    .ant-tabs-tab-btn {
      color: $primary-500 !important;
      font-weight: 500;
    }
  }

  .ant-tabs-ink-bar {
    background-color: $primary-500;
    height: 3px !important;
    border-radius: 3px 3px 0 0;
  }
}

// Responsive typography
.ant-typography {
  &.ant-typography-h1 {
    font-size: $text-3xl;
    
    @media (min-width: $breakpoint-md) {
      font-size: $text-4xl;
    }
  }
  
  &.ant-typography-h2 {
    font-size: $text-2xl;
    
    @media (min-width: $breakpoint-md) {
      font-size: $text-3xl;
    }
  }
  
  &.ant-typography-h3 {
    font-size: $text-xl;
    
    @media (min-width: $breakpoint-md) {
      font-size: $text-2xl;
    }
  }
  
  &.ant-typography-h4 {
    font-size: $text-lg;
    
    @media (min-width: $breakpoint-md) {
      font-size: $text-xl;
    }
  }
  
  &.ant-typography-h5 {
    font-size: $text-base;
    
    @media (min-width: $breakpoint-md) {
      font-size: $text-lg;
    }
  }
}

// Responsive form
.ant-form {
  @media (max-width: $breakpoint-md) {
    .ant-form-item {
      margin-bottom: 16px;
    }
    
    .ant-form-item-label > label {
      font-size: $text-xs;
    }
  }
}

// Responsive layout
.ant-layout {
  .ant-layout-sider {
    @media (max-width: $breakpoint-lg) {
      max-width: 200px !important;
      min-width: 200px !important;
      width: 200px !important;
      
      &.ant-layout-sider-collapsed {
        max-width: 80px !important;
        min-width: 80px !important;
        width: 80px !important;
      }
    }
    
    @media (max-width: $breakpoint-md) {
      max-width: 0 !important;
      min-width: 0 !important;
      width: 0 !important;
      overflow: hidden;
      
      &.ant-layout-sider-collapsed {
        max-width: 0 !important;
        min-width: 0 !important;
        width: 0 !important;
      }
    }
  }
  
  .ant-layout-header {
    @media (max-width: $breakpoint-md) {
      padding: 0 16px;
      height: 56px;
      line-height: 56px;
    }
  }
  
  .ant-layout-content {
    @media (max-width: $breakpoint-md) {
      padding: 16px;
    }
  }
  
  .ant-layout-footer {
    @media (max-width: $breakpoint-md) {
      padding: 12px 16px;
    }
  }
}

// Responsive menu
.ant-menu {
  @media (max-width: $breakpoint-md) {
    .ant-menu-item, 
    .ant-menu-submenu-title {
      padding: 0 16px !important;
      height: 40px !important;
      line-height: 40px !important;
      font-size: $text-xs !important;
    }
  }
}

// Responsive dropdown
.ant-dropdown {
  @media (max-width: $breakpoint-md) {
    .ant-dropdown-menu-item, 
    .ant-dropdown-menu-submenu-title {
      padding: 5px 12px;
      font-size: $text-xs;
    }
  }
}

// Responsive tooltip
.ant-tooltip {
  @media (max-width: $breakpoint-md) {
    .ant-tooltip-inner {
      padding: 6px 8px;
      font-size: $text-xs;
    }
  }
}

// Responsive popover
.ant-popover {
  @media (max-width: $breakpoint-md) {
    .ant-popover-inner-content {
      padding: 8px 12px;
      font-size: $text-xs;
    }
  }
}

// Responsive notification
.ant-notification {
  @media (max-width: $breakpoint-md) {
    .ant-notification-notice {
      width: calc(100vw - 32px) !important;
      margin-right: 16px;
    }
  }
}

// Responsive drawer
.ant-drawer {
  @media (max-width: $breakpoint-md) {
    .ant-drawer-header {
      padding: 12px 16px;
    }
    
    .ant-drawer-body {
      padding: 16px;
    }
    
    .ant-drawer-title {
      font-size: $text-base;
    }
  }
}

// Responsive list
.ant-list {
  @media (max-width: $breakpoint-md) {
    .ant-list-item {
      padding: 8px 0;
    }
    
    .ant-list-item-meta-title {
      font-size: $text-sm;
    }
    
    .ant-list-item-meta-description {
      font-size: $text-xs;
    }
  }
}

// Responsive avatar
.ant-avatar {
  @media (max-width: $breakpoint-md) {
    &.ant-avatar-lg {
      width: 36px;
      height: 36px;
      line-height: 36px;
      font-size: 18px;
    }
    
    &.ant-avatar-sm {
      width: 24px;
      height: 24px;
      line-height: 24px;
      font-size: 12px;
    }
  }
}

// Responsive badge
.ant-badge {
  @media (max-width: $breakpoint-md) {
    .ant-badge-count {
      font-size: 10px;
      height: 18px;
      line-height: 18px;
      padding: 0 4px;
    }
  }
}

// Responsive collapse
.ant-collapse {
  @media (max-width: $breakpoint-md) {
    .ant-collapse-header {
      padding: 8px 12px !important;
      font-size: $text-xs;
    }
    
    .ant-collapse-content-box {
      padding: 8px 12px !important;
      font-size: $text-xs;
    }
  }
}

// Responsive timeline
.ant-timeline {
  @media (max-width: $breakpoint-md) {
    .ant-timeline-item-content {
      font-size: $text-xs;
    }
  }
}

// Responsive steps
.ant-steps {
  @media (max-width: $breakpoint-md) {
    .ant-steps-item-title {
      font-size: $text-xs;
    }
    
    .ant-steps-item-description {
      font-size: $text-xs;
    }
  }
}

// Responsive alert
.ant-alert {
  @media (max-width: $breakpoint-md) {
    padding: 8px 12px;
    font-size: $text-xs;
  }
}

// Responsive message
.ant-message {
  @media (max-width: $breakpoint-md) {
    .ant-message-notice-content {
      padding: 8px 12px;
      font-size: $text-xs;
    }
  }
}

// Responsive result
.ant-result {
  @media (max-width: $breakpoint-md) {
    padding: 24px 16px;
    
    .ant-result-title {
      font-size: $text-lg;
    }
    
    .ant-result-subtitle {
      font-size: $text-xs;
    }
  }
}

// Responsive empty
.ant-empty {
  @media (max-width: $breakpoint-md) {
    .ant-empty-description {
      font-size: $text-xs;
    }
  }
}

// Responsive statistic
.ant-statistic {
  @media (max-width: $breakpoint-md) {
    .ant-statistic-title {
      font-size: $text-xs;
    }
    
    .ant-statistic-content {
      font-size: $text-xl;
    }
  }
}

// Responsive progress
.ant-progress {
  @media (max-width: $breakpoint-md) {
    .ant-progress-text {
      font-size: $text-xs;
    }
  }
}

// Responsive rate
.ant-rate {
  @media (max-width: $breakpoint-md) {
    font-size: 16px;
  }
}

// Responsive slider
.ant-slider {
  @media (max-width: $breakpoint-md) {
    .ant-slider-mark-text {
      font-size: $text-xs;
    }
  }
}

// Responsive switch
.ant-switch {
  @media (max-width: $breakpoint-md) {
    &.ant-switch-small {
      min-width: 24px;
      height: 16px;
      line-height: 16px;
    }
  }
}

// Responsive checkbox
.ant-checkbox-wrapper {
  @media (max-width: $breakpoint-md) {
    font-size: $text-xs;
  }
}

// Responsive radio
.ant-radio-wrapper {
  @media (max-width: $breakpoint-md) {
    font-size: $text-xs;
  }
}

// Responsive calendar
.ant-calendar {
  @media (max-width: $breakpoint-md) {
    .ant-calendar-date {
      font-size: $text-xs;
    }
  }
}

// Responsive time-picker
.ant-time-picker {
  @media (max-width: $breakpoint-md) {
    .ant-time-picker-input {
      font-size: $text-xs;
      height: 32px;
    }
  }
}

// Responsive date-picker
.ant-picker {
  @media (max-width: $breakpoint-md) {
    .ant-picker-input > input {
      font-size: $text-xs;
    }
  }
}

// Responsive upload
.ant-upload {
  @media (max-width: $breakpoint-md) {
    .ant-upload-list-item-name {
      font-size: $text-xs;
    }
  }
}

// Responsive cascader
.ant-cascader {
  @media (max-width: $breakpoint-md) {
    .ant-cascader-menu-item {
      font-size: $text-xs;
    }
  }
}

// Responsive tree
.ant-tree {
  @media (max-width: $breakpoint-md) {
    .ant-tree-node-content-wrapper {
      font-size: $text-xs;
    }
  }
}

// Responsive transfer
.ant-transfer {
  @media (max-width: $breakpoint-md) {
    .ant-transfer-list-header-title {
      font-size: $text-xs;
    }
    
    .ant-transfer-list-content-item {
      font-size: $text-xs;
    }
  }
}

// Responsive descriptions
.ant-descriptions {
  @media (max-width: $breakpoint-md) {
    .ant-descriptions-item-label,
    .ant-descriptions-item-content {
      font-size: $text-xs;
      padding: 8px 12px;
    }
  }
}

// Responsive comment
.ant-comment {
  @media (max-width: $breakpoint-md) {
    .ant-comment-content-author-name {
      font-size: $text-xs;
    }
    
    .ant-comment-content-detail {
      font-size: $text-xs;
    }
  }
}

// Responsive mentions
.ant-mentions {
  @media (max-width: $breakpoint-md) {
    font-size: $text-xs;
  }
}

// Responsive anchor
.ant-anchor {
  @media (max-width: $breakpoint-md) {
    .ant-anchor-link-title {
      font-size: $text-xs;
    }
  }
}

// Responsive back-top
.ant-back-top {
  @media (max-width: $breakpoint-md) {
    right: 20px;
    bottom: 20px;
  }
}

// Responsive spin
.ant-spin {
  @media (max-width: $breakpoint-md) {
    &.ant-spin-lg .ant-spin-dot {
      font-size: 28px;
    }
  }
}

// Responsive skeleton
.ant-skeleton {
  @media (max-width: $breakpoint-md) {
    .ant-skeleton-title {
      height: 16px;
    }
    
    .ant-skeleton-paragraph > li {
      height: 12px;
    }
  }
}

// Responsive image
.ant-image {
  @media (max-width: $breakpoint-md) {
    .ant-image-preview-operations {
      padding: 8px;
    }
  }
}

// Responsive typography
.ant-typography {
  @media (max-width: $breakpoint-md) {
    &.ant-typography-edit-content {
      font-size: $text-xs;
    }
  }
}

// Responsive space
.ant-space {
  @media (max-width: $breakpoint-md) {
    &.ant-space-vertical > .ant-space-item {
      margin-bottom: 8px !important;
    }
    
    &.ant-space-horizontal > .ant-space-item {
      margin-right: 8px !important;
    }
  }
}

// Responsive divider
.ant-divider {
  @media (max-width: $breakpoint-md) {
    &.ant-divider-horizontal {
      margin: 16px 0;
    }
    
    &.ant-divider-vertical {
      margin: 0 8px;
    }
    
    .ant-divider-inner-text {
      font-size: $text-xs;
    }
  }
}

// Responsive affix
.ant-affix {
  @media (max-width: $breakpoint-md) {
    z-index: 10;
  }
}

// Responsive tag
.ant-tag {
  @media (max-width: $breakpoint-md) {
    font-size: 10px;
    padding: 0 6px;
    height: 20px;
    line-height: 18px;
  }
}

// Responsive color-picker
.ant-color-picker {
  @media (max-width: $breakpoint-md) {
    .ant-color-picker-trigger {
      width: 28px;
      height: 28px;
    }
  }
}

// Responsive segmented
.ant-segmented {
  @media (max-width: $breakpoint-md) {
    .ant-segmented-item-label {
      font-size: $text-xs;
      padding: 4px 8px;
    }
  }
}

// Responsive watermark
.ant-watermark {
  @media (max-width: $breakpoint-md) {
    font-size: $text-xs;
  }
}

// Responsive tour
.ant-tour {
  @media (max-width: $breakpoint-md) {
    .ant-tour-content {
      width: calc(100vw - 32px);
    }
    
    .ant-tour-title {
      font-size: $text-sm;
    }
    
    .ant-tour-description {
      font-size: $text-xs;
    }
  }
}

// Responsive float-button
.ant-float-button {
  @media (max-width: $breakpoint-md) {
    width: 40px;
    height: 40px;
    
    .ant-float-button-body {
      width: 40px;
      height: 40px;
    }
  }
}

// Responsive qrcode
.ant-qrcode {
  @media (max-width: $breakpoint-md) {
    .ant-qrcode-errorIcon {
      font-size: 32px;
    }
  }
}

// Responsive flex
.ant-flex {
  @media (max-width: $breakpoint-md) {
    &.ant-flex-gap-small {
      gap: 4px;
    }
    
    &.ant-flex-gap-middle {
      gap: 8px;
    }
    
    &.ant-flex-gap-large {
      gap: 16px;
    }
  }
}

// Responsive wave
.ant-wave {
  @media (max-width: $breakpoint-md) {
    --wave-motion-duration: 0.2s;
  }
}

// Responsive app
.ant-app {
  @media (max-width: $breakpoint-md) {
    font-size: $text-xs;
  }
}
